package com.heiye.oss.api.api;

import com.heiye.framework.common.response.Response;
import com.heiye.oss.api.config.FeignFormConfig;
import com.heiye.oss.api.constant.ApiConstants;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestPart;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author: heiye
 * @date: 2024/11/27 上午11:43
 * @version: v1.0.0
 * @description: TODO
 */
@FeignClient(name = ApiConstants.SERVICE_NAME, configuration = FeignFormConfig.class)
public interface FileFeignApi {

    String PREFIX = "/file";

    /**
     * 用户头像上传
     *
     * @param avatar
     * @return
     */
    @PostMapping(value = PREFIX + "/upload/avatar", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
    Response<?> uploadAvatar(@RequestPart(value = "avatar") MultipartFile avatar);
}
